package com.sz.biz.logistics.ord.service.impl;

import com.sz.biz.common.constants.ErrorCodes;
import com.sz.biz.logistics.bill.dto.BillingDto;
import com.sz.biz.logistics.bill.dto.BillingGenerateDto;
import com.sz.biz.logistics.ord.entity.OrdServiceBill;
import com.sz.biz.logistics.ord.service.OrdServiceBillHistoryService;
import com.sz.biz.logistics.ord.service.OrdServiceBillService;
import com.sz.biz.trade.constants.TrdConstants;
import com.sz.common.base.dao.ParamData;
import com.sz.common.base.dto.QResultDto;
import com.sz.common.base.dto.QueryParams;
import com.sz.common.base.exception.Exceptions;
import com.sz.common.base.service.AbstractService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.*;

/**
 * Function: 服务计费 <br>
 * Author: hpeng.wang. <br>
 * Date: 2017-03-31 13:53:00.
 */
@Service("ordServiceBillHistoryService")
public class OrdServiceBillHistoryServiceImpl extends AbstractService implements OrdServiceBillHistoryService {
    @Override
    protected String getMapperNamespace() {
        return "com.sz.biz.logistics.ord.entity.mapper.OrdServiceBillHistoryMapper";
    }

    @Override
    public void save(OrdServiceBill entry) {
        dao.save(getSqlName("insertSelective"), entry);
    }

    @Override
    public OrdServiceBill findById(Integer id) {
        return null;
    }


    /**
     * 根据单号和类型查询
     *
     * @param orderNo orderNo
     * @param type    1采购价 2销售价
     * @return
     */
    @Override
    public List<OrdServiceBill> findByOrderNoAndType(String orderNo, int type) {
        ParamData paramData = new ParamData();
        paramData.put("type", type);
        paramData.put("orderNo", orderNo);
        return dao.findForList(getSqlName("findByOrderNoAndType"), paramData, OrdServiceBill.class);
    }


}
